home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-09-02 | 13.5 KB | 303 lines | [TEXT/CCL2] |
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; about-marking-menus.lisp
- ;;
- ;; Copyright © 1992 University of Toronto, Department of Computer Science
- ;; All Rights Reserved
- ;;
- ;; author: Mark A. Tapia
- ;;
- ;; A description of the menu-enhancements package and the underlying
- ;; concepts.
- ;;
- ;; Acknowledgements:
- ;; This package uses routines from the oodles-of-utils package in the
- ;; gdevice-u, quickdraw-u and patches modules.
- ;; The routines are credited when used.
- ;;
- ;; Revision history:
- ;; 1992-05-13 Added support for color screens and automatic menu sizing
- ;; 1992-05-24 Added support for MCL2.0f
- ;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (in-package cl-user)
-
- #|
- Menu extensions
- The mixins in menu extensions allow the designer to associate
- a menu with a view without modifying the menu-bar and to
- invoke a menu by holding the mouse button down within the
- view. Menus of this form can pop up anywhere in the view.
- The mixins in menu extensions also add a subclass of
- menu-items that remember the checkmark character.
-
- The menu extensions are defined in a package called
- :menu-enhancements with a nickname of :menus.
-
- Running the demonstrations
- The menu extension package contains two demonstration files that
- exercise the various features of marking menus.
-
- To run the demos, perform the following steps:
- 1. If you are running MCL2.0 final or higher, you will need to
- load
- load-demos.lisp
- Otherwise load
- load-demos-old.lisp
-
- Loading the file will automatically recompile the files if needed,
- will load the fasl files for marking menus and for the demos.
-
- Note:
- If the files are not in ccl: directory, you will need to modify
- the directory structure.
- If you are running MCL2.0f, change the setf expressions for the
- logical-pathname-translations in load-demos.lisp.
- Otherwise change the def-logical-directory in load-demos-old.lisp
-
- 2. Run the demos by evaluating one of the two forms:
- (cl-user::hier-demo) ; to run the hierarchical demo
-
- (cl-user::marking-demo) ; to run the standard marking menu demo
-
- Functions with the suffix -demo, demonstrate individual features
- of marking-menus: These functions are accessible in the cl-user package.
- (cl-user::nested-demo) ; marking menus with nested views
- (cl-user::table-demo) ; marking menus with tables
- (cl-user::marking-demo) ; nested-demo/table-demo
- ; and change the options
- (cl-user::hier-demo) ; demonstrate hierarchical menus
-
- Files
- There are several files in this directory:
- about-marking-menus.lisp ; this file
-
- check-menu-item.lisp ; defines menu-items that remember checkmarks
-
- hier-menu-demo.lisp ; sample code which demonstrates
- ; hier marking menus
-
- load-demos.lisp ; loads the MCL2.0 final version of menus and demos
-
- load-demos-old.lisp ; loads the MCL2.0b1 version of menus and demos
-
- load-menus.lisp ; loads the MCL2.0 final version of menus
-
- load-menus-old.lisp ; loads the MCL2.0b1 version of menus
-
- make-menus.lisp ; compiles and loads the menu-enhancements
- ; package
-
- marking-menu.lisp ; defines a class of pop up marking menus
- ; menu items within a -marking-menu can
- ; also be marking-menus
-
- marking-menu-demo.lisp ; a demonstration of marking menus and check
- ; menu items
-
- oou-utils.lisp ; utility routines from oodles-of-utils.lisp
- ; including macros for executing forms after saving
- ; rectangular portions of screen bit maps
- ; and then restoring them upon termination
-
- Using the marking menus in your program
- To use the menu extensions, perform the following steps
- 1. If you are running MCL2.0 final or higher, you will need to
- load
- load-menus.lisp
- Otherwise load
- load-menus-old.lisp
-
- Loading the file will automatically recompile the files if needed,
- will load the fasl files for marking menus and for the demos.
-
- Note:
- If the files are not in ccl: directory, you will need to modify
- the directory structure.
- If you are running MCL2.0f, change the setf expressions for the
- logical-pathname-translations in load-menus.lisp.
- Otherwise change the def-logical-directory in load-menus-old.lisp
-
-
- 2. Include the following statement to access the menu extensions
- (use-package :menus)
-
- 3. Include the following calls to require:
- (require 'marking-menus) ; to use marking menus
-
- (require 'check-menus) ; to use menu-items that remember
- ; the checkmark character
-
- A desciption of marking menus
- Marking menus are similar to pop-up-menus. Unlike pop-up-menus, a marking menu
- can be activated at any point in a marking-menu-view by pressing the mouse
- button down and either waiting or moving. The menu appears whenever the
- mouse button is still depressed and the mouse does not move appreciably in
- a specified period of time. Marking menus are described in
- Kurtenbach, G. & Buxton W. (1991) Issues in combining marking and
- direct manipulation techniques. Proceedings of UIST '91,
- New York:ACM, 137-144
-
- Unlike pop-up menus, marking-menus occupy screen space only when
- they pop up; selections can be made from a marking menu without
- displaying the menu by marking ahead.
-
- Marking menus allow the designer to associate menus with specific views
- and to activate the menu whenever there is a mouse click within the
- most specific view. Double-click actions are also supported. Marking
- menus eliminate cluttered menu bars, since they use the context supplied
- by the view.
-
- A marking menu is very much like a regular pop up menu. When a user
- presses the mouse button down over a view with a marking menu,
- the menu pops up at that location.
-
- A marking menu differs from a regular pop-up menu in several ways.
- First, a marking menu is circular or spoke-like. Second, a
- marking menu occupies screen space only when it pops up and is
- otherwise invisble. Third, selecting from a pie menu is faster
- than selecting an item from a regular linear pop-up menus,
- since selections depend on the angle between the cursor when it
- is released and the center of the menu and not with the distance.
-
- Selection from a marking menu can be accelerated by moving the cursor
- in the direction of the desired item, without waiting for the menu
- to pop up. The cursor leaves an ink trail or mark to provide feedback
- on the selected direction. The marks provide the impetus for the name
- of this class of menus - marking menus.
-
- The idea is that frequent use of the menu allows the user to learn
- the direction for menu items and to make the mark without waiting
- for the menu to appear. Using menus without waiting is faster and
- eliminates irritating blinking graphics associated with standard
- pull-down or pop-up menus.
-
- Marking menus support both novices and experts and encourage a smooth
- transition between the two styles of interaction:
- * The first time or novice users wait for the the pop-up marking
- menu to appear before moving and making a selection.
- * Experts select menu choices more quickly by making a mark
- without waiting for the menu to pop-up. Experts memorize the
- directions associated with frequently used menu items.
- Standard linear pop-up (or pull-down) menus force experts to
- use a separate mechanism for fast selection (e.g. command-key
- short-cuts) to avoid menu display.
- * Users who are neither novices not experts can make a mark, then
- wait for the menu to pop up before releasing the button. Waiting
- at any time without releasing the botton causes the menu to pop up.
- If an incorrect item is selected, another one can simply be
- selected.
-
- To accommodate both experts and novices, a marking menu pops up
- only after a time delay during which the mouse is relatively static
- while the mouse button is still depressed. Selections from the menu
- occur whenever the user moves a sufficient distance from the initial
- mouse click position and releases the button. Like command key
- short-cuts, marking menus allow the user to issue commands quickly
- without venturing outside the area of interest. Unlike command-key
- short cuts, marking menus do not cause distracting menu-bar flashing.
-
- A marking menu is active whenever the mouse button is pressed down
- in a marking-menu-view. The menu is associated with most specific
- marking-menu-view containing the point. The center of the menu
- coincides with the initial point.
-
- Releasing the button within the center of the menu does not select
- an item.
-
- Releasing the botton outside the central hole, selects an item if
- it is not disabled and runs the associated menu-item-action.
-
- The menu is displayed whenever the mouse button is down, and
- menu-pop-up-time clicks have elapsed while the mouse position
- has changed at most menu-start-tol pixels in the h and v
- direction from the previous position.
-
- When the menu is displayed, a rubber band line joins the current
- mouse position to the center of the menu (the initial position of
- the mouse-click). When the line passes through a wedge corresponding
- to an enabled item, the item appears in reverse video. Disabled menu
- items appear in grayish text and are not hilited.
-
- Novices can wait for the menu to appear, before selecting an item.
-
- Expert users can bypass the menu display, by mousing ahead and then
- releasing the button. The mouse leaves an ink trail that may traverse
- the entire screen.
-
- Intermediate users (or experts who forget the marks) can pause at
- any time to allow the menu to pop up.
-
- Hierarchical marking menus
- Marking menus also support hierarchical menus. Menu items in a
- hierarchical marking menu (marking-menu-view) may also be marking
- menu views. Although the menus may be nested to any depth, menus
- should be no more than three deep. With four choices at each
- level, this allows 64 menu choices.
-
- Hierarchical menus support simple backtracking.
-
- To invoke a marking menu, press the mouse button down within a view.
- A menu will then appear. To select a standard menu item, release
- the mouse outside the central circle. To select a menu item that
- is also a menu, hold the mouse button down, continue moving away
- from the central area until the next marking menu appears
- (it appears outside the circle defining the menu).
- To select a menu item, move in the direction of the menu item.
- Release the button to select a standard menu item; for menu
- items that are menus, repeat the process.
-
- You can also start the process by moving outside the circle
- leaving a mark and then pausing until the root menu and
- the marking sub-menu appear. Ultimately the system will
- allow you to make marks without displaying the menus.
-
- Returning to the central region of a previous menu and pausing,
- returns control to that menu. When the pause point appears in
- the interior circle of more than one marking menu, control will
- return to the most recent menu. Releasing the button before
- the next marking menu appears and before venturing outside
- the circle cancels the entire sequence of menus.
-
- Exported classes:
- The menus package exports the following classes of objects:
- marking-menu-view ; marking menus for views
- marking-menu-window ; windows
- marking-menu-table ; tables
-
- The classes are described below, for information on the initargs and
- the relevant methods, see the source code file.
-
- Marking-menu-views ; a mixin of marking-menu and view
- a marking-menu-view is a view which has a marking-menu associated with it.
- Marking-views can coexist with other items: editable dialog-items, buttons,
- table-dialog-items, check-boxes. Mouse clicks are handled by the most specific
- view that has a mouse-click-event-handler. For example, if a marking-view
- contains a check-box-dialog-item, pressing the mouse down in the dialog-item
- will check/uncheck the item and the marking menu will not appear.
-
- Marking-menu-window ; a mixin of marking-menu-view and window
- A marking-menu-window is a window with a marking-menu associated with the
- content region of the window (not with the close box, title bar, grow box,
- size box, scroll bars etc.)
-
- Check-menu-items
- Check-menu-items store the check mark associated with them. The mark can
- be specified in three ways:
- 1. by specifying the mark when initializing the instance.
- (make-instance 'check-menu-item :mark #\CheckMark)
- which is equivalent to (make-instance 'check-menu-item :mark t)
- 2. by the set-check-mark-char method specifying a mark that is not t or nil.
- (set-check-mark-char check-menu-item mark)
- 3. by the set-menu-item-check-mark method specifying a mark that
- is not t or nil.
- (set-check-menu-item-check-mark check-menu-item mark)
- (set-menu-item-check-mark check-menu-item t) uses the previously
- specified check mark.
-
- Methods 1-2 do not check the item. Method 3 changes the character and checks
- the item.
-
- Use the initarg :mark to set the character (default #\checkMark)
- Use (set-check-mark char menu-item char) to set the character
- or (set-menu-item-check-mark menu-item char) where char is not t or nil
- |#